import { loadConfig } from "./configLoader";
import { initMainEventsListen } from "./renderEventManager";
import { ImageSocketIo } from "./socketIo/ImageSocketIo";
import { initStore } from "@/main/service/storeManager";
import {Share} from "./share";
import {log} from './logManager';
import { Config } from "@/common/config";

export const init = async (): Promise<void> => {
  log.info('init...')
  loadConfig();
  log.info('config...')
  initStore();
  log.info('init store...')
  initMainEventsListen();

  if (Config.socketInMainThread){
    log.info('socket io connect...')
    Share.imgSocketIo = new ImageSocketIo();
    Share.imgSocketIo.connect();
  }
};
